from flask_restplus import Resource, Namespace, fields, marshal, reqparse

get_parser = reqparse.RequestParser()
get_parser.add_argument('search_str', type=str, help='搜索，支持正则')
get_parser.add_argument('current', dest='page', type=int, default=1, help='current_page')
get_parser.add_argument(
    'pageSize', dest='page_size', type=int, choices=[2, 5, 10, 20, 40, 1000], default=20, help='per_page')
# todo 根据前端转换
get_parser.add_argument(
    'order_by', dest='sorted_by', type=str, choices=['name', 'create_datetime', 'update_datetime', 'date'],
    default='create_datetime', help='sorted_by')
get_parser.add_argument(
    'order_by_type', dest='sorted_by_type', type=str, choices=['desc', 'asc'], default='desc', help='sorted_by_type')
# 额外增加是否启用
# get_parser.add_argument('is_active', type=str, choices=["false", "true"], help='是否启用')
get_parser.add_argument('is_active', type=bool, choices=[True, False], help='是否启用')
